clear

%  Plot audio time signal
info = audioinfo('kids.m4a');
[y,Fs] = audioread('kids.m4a');
% sound(y, Fs);
t = 0:seconds(1/Fs):seconds(info.Duration);
t = t(1:end-1);
% plot(t, y)
% xlabel('Time')
% ylabel('Audio Signal')
% L = length(y)
% 
% n = 2^nextpow2(L);

% Plot  
fftY = fft(y);
n = length(y);
f = (0:n-1)*(Fs/n); 
power = abs(y).^2/n;

plot(f, power) 



